import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { registerMicroApps, start } from 'qiankun';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));

registerMicroApps([
  // {
  //   name: 'angular7-hash',
  //   entry: '//localhost:7100',
  //   container: '#container',
  //   activeRule: '/app-angular7-hash',
  // },
  {
    name: 'angular7-history',
    entry: '//localhost:7200',
    container: '#container',
    activeRule: '/app-angular7-history',
  },
  // {
  //   name: 'angular9-hash',
  //   entry: '//localhost:7300',
  //   container: '#container',
  //   activeRule: '/app-angular9-hash',
  // },
  {
    name: 'angular9-history',
    entry: '//localhost:7400',
    container: '#container',
    activeRule: '/app-angular9-history',
  },
  {
    name: 'jquery',
    entry: '//localhost:7500',
    container: '#container',
    activeRule: '/app-jquery',
  },
  {
    name: 'react16-hash',
    entry: '//localhost:7600',
    container: '#container',
    activeRule: '/app-react16-hash',
  },
  {
    name: 'react16-history',
    entry: '//localhost:7700',
    container: '#container',
    activeRule: '/app-react16-history',
  },
  {
    name: 'vue2-hash',
    entry: '//localhost:7800',
    container: '#container',
    activeRule: '/app-vue2-hash',
  },
  {
    name: 'vue2-history',
    entry: '//localhost:7900',
    container: '#container',
    activeRule: '/app-vue2-history',
  },
  {
    name: 'vue3-hash',
    entry: '//localhost:8100',
    container: '#container',
    activeRule: '/app-vue3-hash',
  },
  {
    name: 'vue3-history',
    entry: '//localhost:8200',
    container: '#container',
    activeRule: '/app-vue3-history',
  },
]);
// 启动 qiankun
start();